<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../layui/css/layui.css" media="all">
<title>生产计划增加</title>
</head>

<body>

	<fieldset class="layui-elem-field layui-field-title"
		style="margin-top: 20px;">
		<legend>生产计划增加列表</legend>
	</fieldset>

	<form class="layui-form" action="../../../production/add.action"
		method="post" id="myform">
		<input type="hidden" id="proId" name="proId">
		<div class="layui-form-item">
			<label class="layui-form-label">企业名称</label>
			<div class="layui-input-block">
				<input type="text" name="entName" id="entName"
					lay-verify="required" placeholder="请输入" autocomplete="off"
					class="layui-input" maxlength="10">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">生产地区</label>
			<div class="layui-input-block">
				<select name="preId" id="preId"
					autocomplete="off" class="layui-input" lay-verify="required">
					<option></option>
				</select>
			</div>
		</div>
		<div class="layui-form-item">
	      	<label class="layui-form-label">开始日期</label>
	        <div class="layui-input-inline">
	          <input type="text" name="startTime" id="startTime" 
	          lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" 
	          class="layui-input">
	        </div>
	        <label class="layui-form-label">完成日期</label>
		     <div class="layui-input-inline">
		        <input type="text" name="endTime" id="endTime" 
		        lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" 
		        class="layui-input">
		     </div>
	    </div>
	    <div class="layui-form-item layui-form-text">
		     <label class="layui-form-label">生产许可</label>
		     <div class="layui-input-block">
		        <textarea id="proScope" name="proScope" 
		        placeholder="请输入内容" class="layui-textarea" 
		        lay-verify="required" maxlength="240"></textarea>
		     </div>
		</div>
		<!-- 提交重置 -->
		<div class="layui-form-item">
			<div class="layui-input-block">
				<input  type="submit" class="layui-btn" lay-submit=""
				lay-filter="productionAdd" value="立即提交">
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>

	<script src="../../../layui/layui.js"></script>
	<script type="text/javascript" src="../../../res/wzw/js/jquery.min.1.6.4.js"></script>
	<script src="../../../res/wzw/js/jquery-1.10.2.js"></script>

	<script>
	layui.use(['form', 'layer','laydate'], function(){
	  var form = layui.form
	  ,layer = layui.layer
	  ,laydate = layui.laydate
	  ,$ = layui.$;
	  
	  //日期
	  laydate.render({
	    elem: '#startTime'
	  });
	  laydate.render({
	    elem: '#endTime'
	  });
	  
	  form.on('submit(productionAdd)',function(){
		  parent.location.reload(); // 父页面刷新
	  }); 
	  
	  var url = "../../../pre/findAlls.action";
		$.post(url,null,function(data){
			for(var i=0;i<data.length;i++){
				$("#preId").append("<option value="+data[i].preId+">"+data[i].preSite+"</option>");
			}
			//form表单重新渲染
			form.render();
		},dataType="JSON");
	});
</script>

</body>
</html>